package com.java.singleton;

/**
 * 会有线程安全问题
 * @author jingjintao
 * @date 2021/10/29 - 21:25
 **/
public class Singleton4 {

    private Singleton4(){

    }

    private static Singleton4 instance ;

    public static Singleton4 getInstance() throws InterruptedException {
        if(instance == null){
            Thread.sleep(300);
            instance = new Singleton4();
        }
        return instance;
    }
}
